<?php

namespace App\Http\Controllers;

class UseCard extends Base
{

    public function logic()
    {
        if (isset($this->param['item'])) {
            $item = $this->param['item'];
        } else {
            $this->returnError(1, "请输入物品ID");
        }
        if (isset($this->param['code'])) {
            $code = $this->param['code'];
        } else {
            $this->returnError(2, "请输入物品校验码");
        }
        $ret = $this->use_card($item, $code);
        if ($ret) {
            echo "物品扣除成功";
        } else {
            echo "物品扣除失败";
        }
    }

}
